﻿//Mr Inventory by David Mauler 10.2.2010
//Mr Inventory is released under the 
//GNU General Public License version 2 (GPLv2)

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Collections;

public partial class delserv : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public void onClick_bSearch(object sender, EventArgs e)
    {
        ArrayList servList = new ArrayList();
        ServerSql sqlFind = new ServerSql();
        servList = sqlFind.findByName(tbSerName.Text);

        ddServFnd.Items.Clear();

        if (servList == null)
        {
            lbMessage.Text = "<p class='evenLine'>No servers were found with that name</p>";
        }
        else
        {
            foreach (string server in servList)
            {
                ddServFnd.Items.Add(server);
            }
        }
    }

    public void onClick_bDelete(object sender, EventArgs e)
    {
        ServerSql sqlDelete = new ServerSql();

        lbMessage.Text = "<p class='evenLine'>" + sqlDelete.deleteServr(ddServFnd.SelectedValue.ToString()) + "</p>";
    }

}
